﻿@{
    ResFile = "cms_Metas";
    List<CmsKeyValueItem> values = (ViewData["Values"] as List<CmsKeyValueItem>) ?? new List<CmsKeyValueItem>(){new CmsKeyValueItem()};
}

<fieldset class="b-form" id="">
            <ol class="b-form__rows ul-reset g-clear js-items">                       
				<li class="b-form__row g-clear">					
					<ol class="b-form__rows_properties ul-reset g-clear">
					    <span class="b-form__row g-clear">
					        <label class="label_wide"><b>@_("Values (leave label empty to remove value)")</b></label>
					    </span>
	                    @for (int i = 0; i < values.Count; i++)
	                    {
	                        <li class="b-form__row g-clear js-item @(i == 0 ? "js-first-item" : "")">
	                            <div class="b-form__row__inner">
	                                <label for="">@_("Label")</label><br />
	                                @Html.TextBox("Values["+i+"].Value", values[i].Value, new { @class = "text" })      	                    		
	                            </div>
	                            <div class="b-form__row__inner">
	                                <label for="">@_("Key")</label><br />
	                                @Html.TextBox("Values["+i+"].Key", values[i].Key, new { @class = "text" })
	                            </div>     
	                            <div class="b-form__row__inner">
	                                <label for="">@_("Selected")</label><br />
	                                @Html.CheckBox("Values["+i+"].Selected", values[i].Selected ,new {@class="js-selected-checkbox"})
	                            </div>
	                        </li>
                        }						
					</ol>
				</li>
				<li class="b-form__row g-clear">
					<a href="#" class="b-button js-add-more-item" data-container=".js-items">@_("Add more values")</a>
				</li>
            </ol>            
        </fieldset>

